home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-3452
/
articles
/
bubble.doc
< prev
next >
Wrap
Text File
|
1987-04-21
|
5KB
|
138 lines
BUBBLE FIELD MAKER/DISPLAYER
BY EDDIE BRYAN
What is a bubble field, well according to me it is a star field,
which instead of having tiny stars, has sprites, and these
sprites look like like bubbles, hence the name.....
There are two sources in the bubble folder, one is the field
designer, and the other is the display routine, the maker source
is just an adapted version on the star field generator in HP
issue 1, so I wont go into how that works (see end of article for
explanation on how the field designer works).
The field display routine simply sets logical screen to point at
back, every vertical blank the old bubbles are wiped off the
screen , and the new ones are drawn, the bubbles themselves are 2
plane images, so you only need set the first 3 colours to change
their colour, the display routine uses about 1/3 processor time,
but this will change depending on how many bubbles you have.
If you look at the display source, you will see that the drawing
is done by a small 68000 program, the DREG(0) is set to the
number of bubbles-1, bank(5) has field data, every VBL a constant
is added to ST(field frame), this number is the number of
bubbles*4, so 20 bubbles will be equal to 80(get it??, didn't
think so!)
Now here is the instructions for STARFIELD MAKER.......
STOS STARFIELD DESIGNER
~~~~~~~~~~~~~~~~~~~~~~~
BY
WILLIAM BRYAN
"God, I wish I could work out the waves for those bloody
starfields everybody is doing these days!", said Eddie, or at
least something with the same meaning, to Will, mathematical
problem solver extroudinair.
"Well, I'm sure I'll be able to fit you in sometime this year
(being 1991)..........NURSE.....CAN YOU SEND THE NEXT PATIENT IN
PLEASE?"
Well, it was November, that's right the month before
December and the one after October, or is it August, or may be
July, sod it, I can't remember, when I finally started.
The routine works basically like this, define vanashing point (In
low res 160,100) where all stars will zoom out from at a radius
set from this point. A number of arrays are set up to hold X and
Y positions for each star for each frame.
Using the SIN and COSINE functions available in stos the X and Y
postions can be worked out for each star in each frame by
increasing the radius GEOMETRICALLY (Multiplying by say 1.25) or
ARITHMATICALLY (Adding 2) each time. This process creats the feel
of the stars zooming past.
Well you now how it's supposesd to work, but forget about that,
this is how it really works, for all you LAMERS out their, not
mentioning any names, JOHN GREEN.
At line 48 and 49 in the programme (Ooh arr, misses) a large
number of varibubbles (As I like to call them) are set to
different values, these of cause have drastic effects on the out
come of the starfield.
YMX - The maximum value of Y for a star, once beyond this
point the star is ignored and isn't shown or stored
YMN - The minimum value of Y - See above
XMX - The maximum value of X - See YMX
XMN - The minimum value of X - See above
HOW TO MAKE YOUR STARS LOOK GOOD (Part I)
AIN# - ANGLE INCREASE VALUE (per frame) By setting this
different to 0 you can creat spiraling starfields, at
least as good as the starfield on OOH CRIKEY WHAT A SCORCHER
AF# - Accelleration factor/increase. If prop is set to 1
then the radius of the stars from the origin is multiplyed by
this figue, else AF# is added to the radius
PROP - See above
NS - Number of stars - USES UP MEMORY VERY QUICKLY WHEN
INCREASED
NF - Number of frames - USES UP MEMORY VERY QUICKLY WHEN
INCREASED
MNR - Minimum radius value - for first frame of every star
MXR - Maximum radius value - see above
MNA - Minimum angle - used for creating semi-circular and
other sized/shaped starfields
MXA - Maximum angle - see above
DCP# - Depth Cued Percentage - set to 0.5 for grey stars
first half of frames and second half white stars, can be chanegd
to create better effects
SX - Is automatically set to centre of starfield area -
should be changed to make optimumum use of semi-circular
starfields, etc
SY - Y centre - see above
Well the programme.....
lines 55-100 create star flight paths
lines 110-240 rearrange stars so they don't all start at
same point and it chooses depth cued stars
lines 20000+ VECTCON.BAS built in to save a hell of a lot of
memory
lines 1000-1230 DOT DISPLAY ROUTINE - Built in for easy use,
uses machine code routine in bank 9 to plot stars
Well I hope you have more fun with my Starfield designer that I
had writing this artical for STOS BITS 2, HP SOURCE what ever you
want to call it.